package com.hc.action;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

public interface AccountAction {

    @TwoPhaseBusinessAction(name = "tcc-account")
    void reduceMoney(BusinessActionContext context,
                     @BusinessActionContextParameter("accountId") int accountId,
                     @BusinessActionContextParameter("amount") double amount);

    void commit(BusinessActionContext context);

    void rollback(BusinessActionContext context);
}
